package com.button.boot.multithread;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;

import com.button.boot.multithread.service.impl.ThreadExecutetask;

@SpringBootApplication
public class SpringBootMultiThreadApplication {
    public static void main(String[] args) {
        ConfigurableApplicationContext context = SpringApplication.run(SpringBootMultiThreadApplication.class, args);
        ThreadPoolTaskExecutor threadExceutePool = (ThreadPoolTaskExecutor) context.getBean("threadExceutePool");
        threadExceutePool.execute((ThreadExecutetask) context.getBean("threadExecutetask"));  //项目启动则开始执行
    }
}
